<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>添加学习资源</title>
<meta name="description" content="__DESCRIPTION__">
<meta name="keywords" content="__KEYWORDS__">
<link href="__CSS__/common.css" rel="stylesheet" type="text/css">
<link href="__CSS__/Version4Master.css" rel="stylesheet" type="text/css">
<link href="__CSS__/addproject.css" rel="stylesheet" type="text/css">
<link href="__CSS__/validator.css" rel="stylesheet" type="text/css">
<script src="__INCLUDE__/kindeditor/kindeditor-min.js" type="text/javascript"></script>
<script src="__INCLUDE__/kindeditor/lang/zh_CN.js" type="text/javascript" ></script>
<link href="__CSS__/thickbox.css" rel="stylesheet" type="text/css">
<script src="__JS__/jquery-1.8.2.js" type="text/javascript"></script>
<script>
		var editor;
		KindEditor.ready(function(K) {
			editor = K.create('#kindContent', {
				resizeType : 1,
				allowPreviewEmoticons : false,
				allowImageUpload : false,
				items : [
					'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
					'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
					'insertunorderedlist', '|', 'emoticons', 'image', 'link']
			});
		});
</script>
</head>
<body>
<div id="container">
	<!-- ---header部分-- start ---- -->
	<include file="./Match/Tpl/Include/header.html" />
	<!-- ---header部分--  end  ---- -->
    <div class="clear"></div>     
	<div id="content">
		<div id="title">
			<a href="{:U('Student/Home/index')}" class="float_right">返回个人主页</a>
			<h2>
			<if condition="$info.tag eq 1">
			编辑学习资源
			<else /> 添加学习资源
			</if>
			</h2>
		</div>
		<!--<iframe name="addSR" style="display:none;"></iframe>-->
		<form action="__APP__/Public/Resources/AddStudyResources"  method="post" name="aspnetForm" onsubmit="return dosubmit()">
			<input type="hidden" name="tag" value="{$info.tag}" />
			<input type="hidden" name="resourcesid" value="{$info.Id}" />
			<div id="editorHolder">
				<div style="background: none repeat scroll 0% 0% rgb(223, 243, 250); border: 1px dotted rgb(53, 168, 231);" class="edit_item">
					<label class="legend">资源标题：</label>
					<input name="Title" maxlength="50" id="Title" class="inupt_text" type="text" value="{$info.Title}" />
					<span id="TitleTip"></span>
				</div>
				<div style="background: none repeat scroll 0% 0% rgb(255, 255, 255); border: medium none;" class="edit_item">
					<label class="legend" style="float:left; width:70px;">详细内容：</label>
					<textarea id="kindContent" style="width:700px;height:200px;" name="Content">{$info.Content}</textarea>
				</div>
				<div class="edit_item" style="margin-top: 10px; background: none repeat scroll 0% 0% rgb(255, 255, 255); border: medium none;">
					<label class="legend">所属类别：</label>
					<select name="Category" id="Category" >
						<volist name="category" id="vo" >
						<option value="{$vo.Id}"
						<eq name="vo.Id" value="$info.Category">selected</eq>
						>{$vo.CategoryName}</option>
						</volist>
					</select>
					<span id="CategoryTip"></span>
				</div>
			</div>
			<div style="background: none repeat scroll 0% 0% rgb(255, 255, 255); border: medium none;" class="edit_item">
				<label class="legend">原文链接：</label>
				<input value="<if condition='$info.tag eq 1'><else/>http://</if>{$info.Source}" name="Source" maxlength="100" id="Source" class="inupt_text" type="text">
				<span class="onShow" id="SourceTip">如果不是原创资源,请输入原文链接</span>
			</div>
			<div style="background: none repeat scroll 0% 0% rgb(255, 255, 255); border: medium none;" class="edit_item">
				<label class="legend">资源附件：</label>
				<ul id="attachs" style="margin-left: 70px; display: none; min-height: 60px; width: 590px;margin-top: -20px; padding: 5px; border: solid #ddd 1px; background: none repeat scroll 0 0 #FCFAD4;"></ul>				
				<a href="###" ajaxaction="UpLoadAttachFiles" title="添加附件"  id="add" > +添加附件</a>&nbsp;&nbsp;
				<a class="shareto_button" href="http://shareto.com.cn/share.html"><img src="http://s.shareto.com.cn/btn/lg-share-cn.gif" width="125" height="21" alt="分享道" style="border:0"/></a>
				<script type="text/javascript" src="http://s.shareto.com.cn/js/shareto_button.js" charset="utf-8"></script>
				<input type="hidden" size="100" name="HasFiles" id="upfileval" value=""/>
	          	<div style="margin-left: 78px;">
					<fieldset>
						<legend>实施附件</legend>
						<ul>
							<li><span id="toupfile" ></span></li>
						</ul>
					</fieldset>
				</div>
			</div>

			<div id="operate">
				<input name="Send" value="发 布" id="Submit" class="input-button" type="submit">
				<input class="input-button gray" value="取消" onclick="javascript:history.go(-1);" type="button">
			</div>
		</div>
	</form>
    <div class="clear"></div>
	<!-- ---footer部分-- start ---- -->
	<include file="./Match/Tpl/Include/footer.html" />
	<!-- ---footer部分--  end  ---- -->
		
</div>
<script type="text/javascript">
	function uploadCallBack(filename,size){
		if(filename==false){
			alert("文件上传失败,请重新上传");
			$(".load_body").load("__URL__/UpLoadAttachFiles");
		}else{
			document.getElementById("toupfile").innerHTML+=' <a href="__UPFILE__/Doc/StudyResources/'+filename+'" target="_blank">'+filename+'</a>;  ';
			document.getElementById("upres").innerHTML='文件'+filename+'上传完毕,你可以继续选择文件上传<br />';
			document.getElementById("upfileval").value+=filename+'|'+size+';';
			$(".load_body").html("");
			$(".ajaxloadhtml").hide();
		}
	}
</script>
<script type="text/javascript">
	function doCheckTitle(){
		var name = document.aspnetForm.Title.value;
		if(name==''){
			document.getElementById("TitleTip").innerHTML="标题必须填写！";
			document.getElementById("TitleTip").style.color="red";
			return false;
		}else{
			document.getElementById("TitleTip").innerHTML="正确";
			document.getElementById("TitleTip").style.color="green";
			return true;
		}
	}
	
	
	function dosubmit(){
		return (doCheckTitle());
	}
</script>
<include file="./Match/Tpl/Include/ajaxloadhtml.html" />
</body>
</html>